home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk19 / blinker / basiclinker next >
Text File  |  1995-03-18  |  2KB  |  72 lines

  1. '---------------------------------------------------------------------------
  2. '
  3. '                        BASIC Linker
  4. '
  5. '
  6. '                 Copyright 1987 by Brian Zupke
  7. '
  8. '
  9. '    This program creates an executable BASIC program from an object
  10. '  module source library.  Object modules are indicated by the '.sub'
  11. '  extension on the module name.
  12. '
  13. '
  14.   DIM ModulesUsed$(40)
  15.   DIM SHARED TRUE,FALSE,NoError
  16. '
  17. '  constants:
  18. '
  19.   TRUE = -1
  20.   FALSE = 0
  21. '
  22. '  Trap I/O errors
  23. '
  24.   ON ERROR GOTO ProcessError
  25.   NoError = TRUE
  26. '
  27. '  Set program name, disk pathnames, and Compress flags.
  28. '
  29.   CALL GetLinkerInfo.SUB(ProgramName$,LibraryPathname$,ProgramPathname$,Compress)
  30. '
  31. '  Open output file
  32. '
  33.    OPEN ProgramPathname$+ProgramName$+".EXE" FOR OUTPUT AS #2  len = 4096
  34.    IF NoError THEN
  35. '
  36. '  Linke modules to create an executeable program.
  37. '
  38.       CALL LinkModules.SUB(ProgramName$,ModulesUsed$(),Used,ProgramCreated)
  39. '
  40. '  Report results
  41. '
  42.       IF ProgramCreated THEN
  43.          PRINT "Link Complete - Program saved as ";ProgramName$;".EXE"
  44.       ELSE
  45.          PRINT "Link Failed"
  46.       END IF
  47.    ELSE
  48.       PRINT "Unable to open output file - Link Failed"
  49.    END IF
  50.    CLOSE 2
  51.    END
  52. '
  53. '
  54. '  Process I/O errors only.
  55. '
  56. '
  57. ProcessError:
  58.   IF ERR = 53 OR ERR = 61 OR ERR = 64 OR ERR = 68 OR ERR = 70 THEN
  59.     NoError = FALSE
  60.     IF ERR = 70 THEN
  61.       PRINT "Disk write-protected!"
  62.     ELSEIF ERR = 61 THEN
  63.       PRINT "Disk FULL!"
  64.     ELSE
  65.       PRINT "Unable to access file."
  66.     END IF
  67.     RESUME NEXT
  68.   ELSE
  69.     ON ERROR GOTO 0
  70.   END IF
  71.  
  72.